<extend name="Public/base" />

<block name="body">
	<link href="__STATIC__/bootstrap/css/bootstrap.css" rel="stylesheet">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>{$meta_title}</h2>
	</div>
    
    <div class="container-fluid">
    <div class="row">
    	<label>
           	<a class="btn" href="{:U('add')}">新 增</a>
           	<button class="btn ajax-post confirm" url="{:U('del')}" target-form="ids">删 除</button>
    	</label>
    	<form class="form-inline" style="display:inline;" method="post" action="{:U('index')}" role="form">
    		<div class="form-group">
                <input type="text" class="form-control search_input" name="name" placeholder="谱单名称" value="{$_condition['name']}"/>
                <button type="submit" class="btn btn-link" id="search" >
              		<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                </button>
    		</div>
    	</form>
		<button class="btn ajax-get pull-right" url="{:U('Score/count')}">一键更新</button>
    </div>
    
    <div class="row">
    	<div class="div_10"></div>
    </div>
    
    <!-- 数据列表 -->
    <div class="row">
	<table class="table">
    <thead>
        <tr>
		<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
		<th class="" onclick="location='{:U('Score/index?order=id&sort=1')}'" style="cursor:pointer;">ID</th>
		<th class="">谱单名称</th>
		<th class="">标签列表</th>
		<th class="">谱单作者</th>
		<th class="">创建时间</th>
		<th class="" onclick="location='{:U('Score/index?order=sheet_count&sort=2')}'" style="cursor:pointer;">曲谱数</th>
		<th class="" onclick="location='{:U('Score/index?order=comment_count&sort=2')}'" style="cursor:pointer;">评论数</th>
		<th class="" onclick="location='{:U('Score/index?order=fav_count&sort=2')}'" style="cursor:pointer;">收藏数</th>
		<th class="" onclick="location='{:U('Score/index?order=click_count&sort=2')}'" style="cursor:pointer;">点击数</th>
		<th class="" onclick="location='{:U('Score/index?order=share_count&sort=2')}'" style="cursor:pointer;">分享数</th>
		<th class="">操作</th>
		</tr>
    </thead>
    <tbody>
		<notempty name="_list">
		<volist name="_list" id="vo">
		<tr>
            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
            <td>{$vo.id} </td>
			<td><a title="编辑" href="{:U('edit?id='.$vo['id'])}">{$vo.name}</a></td>
			<td>{$vo.tags}</td>
			<td>{$vo['creator']['nickname']}</td>
			<td>{$vo.create_time}</td>
			<td><a title="曲谱列表" href="{:U('ScoreSheet/index?score_id='.$vo['id'])}">{$vo.sheet_count}</a></td>
			<td><a title="评论列表" href="{:U('ScoreComment/index?score_id='.$vo['id'])}">{$vo.comment_count}</a></td>
			<td>{$vo.fav_count}</td>
			<td>{$vo.click_count}</td>
			<td>{$vo.share_count}</td>
			<td>
				<a title="添加曲谱" href="{:U('sheet_add?method=get&score_id='.$vo['id'])}">添加曲谱</a>
            </td>
		</tr>
		</volist>
		<else/>
		<td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
	</tbody>
    </table>
	</div>
    <div class="page">
        {$_page}
    </div>
    </div>
</block>

<block name="script">
	<script src="__STATIC__/bootstrap/js/bootstrap.min.js"></script>
	<script src="__STATIC__/bootstrap-select/js/bootstrap-select.min.js"></script>

	<script type="text/javascript">
	//搜索功能
	$("#search").click(function(){
		$("#search-form").submit();
	});
	//回车搜索
	$(".search_input").keyup(function(e){
		if(e.keyCode === 13){
			$("#search").click();
			return false;
		}
	});
    //导航高亮
    highlight_subnav('{:U('Sheet/index')}');
    $(function(){
    	
    });
	</script>
</block>
